import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index';

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    component:Index,
    redierct:"/home",
    children:[
      {
        path:"/home",
        component: () => import("../views/Home")
      },{
        path:"/commodity",
        component: () => import("../views/Commodity")
      },{
        path:"/order",
        component: () => import("../views/Order")
      },{
        path:"/inventory",
        component: () => import("../views/Inventory")
      },{
        path:"/user",
        component: () => import("../views/User")
      },{
        path:"/promotion",
        component: () => import("../views/Promotion")
      },{
        path:"/freight",
        component: () => import("../views/Freight")
      },{
        path:"/content",
        component: () => import("../views/Content")
      },{
        path:"/statistics",
        component: () => import("../views/Statistics")
      },{
        path:"/finance",
        component: () => import("../views/Finance")
      },{
        path:"/est",
        component: () => import("../views/Est")
      },{
        path:"/jurisdiction",
        component: () => import("../views/Jurisdiction")
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
